﻿using System.Diagnostics.CodeAnalysis;

namespace Gentings.Saas.Sites
{
    internal class AreaProviderComparer : IEqualityComparer<IAreaProvider>
    {
        public bool Equals(IAreaProvider? x, IAreaProvider? y)
        {
            return x?.Area?.Equals(y?.Area, StringComparison.OrdinalIgnoreCase) ?? false;
        }

        public int GetHashCode([DisallowNull] IAreaProvider obj)
        {
            return obj.Area?.GetHashCode() ?? 0;
        }
    }
}